<template>
    <div class="not-found">
        <h1>404</h1>
        <p>你访问的页面不存在～</p>
        <el-button type="primary" @click="goHome">返回首页</el-button>
    </div>
</template>

<script setup>
// 引入 vue-router 的路由方法
import { useRouter } from 'vue-router'
const router = useRouter()

// 返回首页方法
const goHome = () => {
    router.push('/')
}
</script>

<style scoped>
.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
}

h1 {
    font-size: 10rem;
    color: #ff6b6b;
    animation: pulse 1.5s infinite;
}

p {
    font-size: 1.5rem;
    margin: 20px 0;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}
</style>
